<include file="Public/head"/>
<style type="text/css">
    .addTopic {
        padding: 15px 0 40px;
        text-align: left;
    }

    #t_name {
        border: 1px solid #d2d2d2;
        color: #303030;
        font-size: 14px;
        height: 26px;
        line-height: 26px;
        padding: 0 10px;
        width: 600px;
    }
</style>
</head>
<include file="Public/common_header"/>
<div class="mian">
    <include file="Public/sidebar" menu="clcwht.ztgl"/>

    <div class="mianR">
        <h3 class="yonghu">新建问答专题</h3>
        <div class="addTopic">
            <ul>
                <li class="clearfix">
                    <span>名称：</span>
                    <input type="text" name="t_name" id="t_name" placeholder="请输入专题名称"/>
                </li>
            </ul>

            <div class="yongBtn">
                <input name="submit" type="submit" value="确定" class="queding"/>
                <input name="cancel" type="button" class="quxiao" value="取消"/>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <script type="text/javascript">

        $("input[name='submit']").click(function () {
            var t_name = $("#t_name").val();
            if (t_name == '') {
                shibai_alert("保存失败，未填写专题名称");
                return false;
            }
            $.post("/Topic/addTopicData", {t_name: t_name}, function (res) {
                if (res.code == 200) {
                    btn_alert(res.msg);
                    setTimeout(function () {
                        window.location.href = "/Topic/index";
                    }, 2000);
                } else {
                    shibai_alert(res.msg);
                }
            }, 'json');
        });

        $("input[name='cancel']").click(function () {
            window.history.back();
        });
    </script>
    </body>
    </html>
